<?php
//=======================================
//###################################
// Kayako Web Solutions
//
// Source Copyright 2001-2004 Kayako Web Solutions
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2005/06/21 03:25:41 $)
// $RCSfile: staff_ajax.php,v $ : $Revision: 1.2 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//###################################
//=======================================

if (!defined("INSWIFT")) {
	trigger_error("Unable to process $PHP_SELF", E_USER_ERROR);
}

require_once ("./includes/functions_html.php");
require_once ("./includes/functions_comments.php");
require_once ("./modules/teamwork/functions_calendarrender.php");
$template->loadLanguageSection("staff_twcalendar");


/**
* ###############################################
* DAY VIEW FETCH
* ###############################################
*/
if ($_GET["action"] == "twday")
{
	if (!empty($_GET["customtype"]))
	{
		$_customday = $_GET["customtype"];
	} else {
		$_customday = false;
	}
	echo renderDayView($_customday);


/**
* ###############################################
* WORK WEEK FETCH
* ###############################################
*/
} else if ($_GET["action"] == "twworkweek") {
	if (!empty($_GET["customtype"]))
	{
		$_customweek = $_GET["customtype"];
	} else {
		$_customweek = false;
	}
	echo renderWorkWeekView($_customweek);


/**
* ###############################################
* WEEK FETCH
* ###############################################
*/
} else if ($_GET["action"] == "twweek") {
	if (!empty($_GET["customtype"]))
	{
		$_customweek = $_GET["customtype"];
	} else {
		$_customweek = false;
	}
	echo renderWorkWeekView($_customweek, true);



/**
* ###############################################
* MONTH FETCH
* ###############################################
*/
} else if ($_GET["action"] == "twmonth") {
	if (!empty($_GET["customtype"]))
	{
		$_custommonth = $_GET["customtype"];
	} else {
		$_custommonth = false;
	}
	echo renderMonthView($_custommonth);


/**
* ###############################################
* DETAILED / ADDRESS CARDS
* ###############################################
*/
} else if ($_GET["action"] == "detailedcards" || $_GET["action"] == "addresscards") {
	require_once ("./modules/teamwork/functions_contactsrender.php");
$template->loadLanguageSection("staff_twcontacts");

	echo renderContactCards($_GET["action"], $_GET["searchquery"]);
}

?>